package com.smalluz.ad.modules.common.enums;


import java.net.URISyntaxException;

import com.smalluz.ad.modules.common.config.MediaHostConfig;

import lombok.AllArgsConstructor;
import lombok.Getter;

public interface MediaApiUrl {

    default String getUrl() {

        try {
            return MediaHostConfig.buildUrl(this.getPath());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }

        return "";
    }

    default String getKsUrl() {

        try {
            return MediaHostConfig.buildKsUrl(this.getPath());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }

        return "";
    }

    String getPath();
    
    String getName();

    @AllArgsConstructor
    @Getter
    enum ClueUrl implements MediaApiUrl {
        /**
         * get clue page list.
         */
        CLUE_OPEN_API_PAGE_LIST("/open_api/2/tools/clue/get/","头条获取线索列表");

        private final String path;
        
        private final String name;

    }
    
    @AllArgsConstructor
    @Getter
    enum KsClueUrl implements MediaApiUrl {
        CLUE_OPEN_API_PAGE_LIST("/rest/openapi/v2/gemini/crm/clue/list","快手获取线索列表");

        private final String path;
        
        private final String name;

    }
    
    @AllArgsConstructor
    @Getter
    enum KsCampaignUrl implements MediaApiUrl {
        
        //广告信息列表查询
        CAMPAIGN_OPEN_API_PAGE_LIST("/rest/openapi/v1/campaign/list","快手广告计划信息列表查询");

        private final String path;
        
        private final String name;

    }
    

    @AllArgsConstructor
    @Getter
    enum OAuth2 implements MediaApiUrl {
        
        //请求token
        OAUTH2_OPEN_API_OAUTH2_ACCESS_TOKEN("/open_api/oauth2/access_token/","头条获取Access Token"),
        //刷新token
        OAUTH2_OPEN_API_REFRESH_ACCESS_TOKEN("/open_api/oauth2/refresh_token/","头条刷新Refresh Token"),
        //获取已经授权账号
        OAUTH2_OPEN_API_ADVERTISER_GET("/open_api/oauth2/advertiser/get/","头条获取已授权账户");
        
        private final String path;
        
        private final String name;

    }

    @AllArgsConstructor
    @Getter
    enum KsOAuth2 implements MediaApiUrl {

        //请求token
        OAUTH2_OPEN_API_OAUTH2_ACCESS_TOKEN("/rest/openapi/oauth2/authorize/access_token","快手获取Access Token"),
        //刷新token
        OAUTH2_OPEN_API_REFRESH_ACCESS_TOKEN("/rest/openapi/oauth2/authorize/refresh_token","快手刷新Refresh Token");
        
        private final String path;
        
        private final String name;
    }

    @AllArgsConstructor
    @Getter
    enum Account implements MediaApiUrl {
        
        //获取纵横组织下的账户
        ACCOUNT_OPEN_API_MAJORDOMO_ADVERTISER_SELECT("/open_api/2/majordomo/advertiser/select/","头条获取纵横组织下资产账户列表"),;
        
        private final String path;

        private final String name;
        
    }

    @AllArgsConstructor
    @Getter
    enum TTReport implements MediaApiUrl {

        //获取广告计划的数据报表
        REPORT_AD_GET("/open_api/2/report/ad/get/","头条广告计划数据");

        private final String path;
        
        private final String name;
    }
    
    @AllArgsConstructor
    @Getter
    enum KsReport implements MediaApiUrl {

        //获取广告计划的数据报表
        REPORT_AD_GET("/rest/openapi/v1/report/campaign_report","快手广告计划数据");

        private final String path;
        
        private final String name;

    }

    @AllArgsConstructor
    @Getter
    enum BdReport implements MediaApiUrl {
        //获取广告计划的数据报表
        REPORT_AD_GET("/json/sms/service/OpenApiReportService/getReportData","百度广告计划数据");

        private final String path;

        private final String name;
    }

    @AllArgsConstructor
    @Getter
    enum BdClueUrl implements MediaApiUrl {
        //获取广告计划的数据报表
        BD_CLUE_OPEN_API_PAGE_LIST("/json/sms/service/LeadsNoticeService/getNoticeList","百度获取线索信息");

        private final String path;

        private final String name;

    }
    

}
